
package jweslley.ProblemSetVolumes.VolumeIV;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/4/494.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 19/10/2008
 */
public class KindergartenCountingGame {

	public static void main(String[] args) throws IOException {
		char c;
		String line;
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		while ((line = in.readLine()) != null) {
			StringBuilder b = new StringBuilder(line);
			for (int i = 0; i < b.length(); i++) {
				c = b.charAt(i);
				while (i < b.length() && !(Character.isLetter(c) || Character.isWhitespace(c))) {
					b.deleteCharAt(i);
					if (i < b.length())
						c = b.charAt(i);
					else break;
				}
			}
			System.out.println(b.toString().split("\\p{javaWhitespace}+").length);
		}
	}

}
